package com.pinyougou.sellergoods.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.pinyougou.mapper.TbItemCatMapper;
import com.pinyougou.pojo.TbItemCat;
import com.pinyougou.pojo.TbItemCatExample;
import com.pinyougou.sellergoods.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@Service
public class ItemCatServiceImpl implements ItemCatService {
    @Autowired
    private TbItemCatMapper itemCatMapper;
    @Override
    public List<TbItemCat> findOneParent(Long id) {
        TbItemCatExample itemCatExample = new TbItemCatExample();
        itemCatExample.createCriteria().andParentIdEqualTo(id);
        return itemCatMapper.selectByExample(itemCatExample);
    }

    @Override
    public TbItemCat getOneById(long id) {
        TbItemCat itemCat = itemCatMapper.selectByPrimaryKey(id);
        return itemCat;
    }
}
